package demo516;

import java.util.ArrayList;
import java.util.List;

public class Test {
        public static void main(String[] args) {
            Emp emp1 = new Emp("1001", "武则天", 30);
            System.out.println(emp1);
            Emp emp2 = new Emp("1002", "李白", 25);
            Emp emp3 = new Emp("1003", "嫦娥", 21);

            List<Emp> list = new ArrayList();
            list.add(emp1);
            list.add(emp2);
            list.add(emp3);


            for (int i = 0; i < list.size(); i++){
                System.out.println(list.get(i));
            }
        }
    }

